<!--[include file='admin_std_header.htm']-->
<link rel="stylesheet" type="text/css" href="<!--[modulepath]-->/pnjavascript/ddtabmenu/ddtabmenufiles/ddcolortabs_blue.css" />
<script type="text/javascript">
  function getSubCategory(obj){
    var div_subcate = document.getElementById('subcategory_container');
    var category = document.getElementById('filter_category_id_');
    var filter = "&filter=scy_category_id = '" + category.value + "'";
    var name = "&name=form[subcategory_id]";
    var url = "index.php?module=InnoForum&type=ajax&func=selector&ctrl=Sub_Category" + filter + name + genSession() ;
    div_subcate.innerHTML ="Loading...";
    new Ajax.Request(url, {
        method:'get',
        onSuccess: function(transport){
         var result = transport.responseText;
         div_subcate.innerHTML= result;
         }	   
      });
    
  }
  function genSession(){
    return '&r=' + Math.random(999);
  }
</script>
<style>
.status_icon {
  float:left;
  width:60px;
  padding-right:10px;

}
</style>
<div id="ddtabs" class="ddcolortabs">
  <ul>
    <li><a href="<!--[pnmodurl modname='InnoForum' type='admin' func='page' ctrl='home']-->" rel="ct1"><span><!--[pnml name='_INNOFORUM_GLOBAL_TAB_MAINMENU']--></span></a></li>
  </ul>
</div>
<div class="ddcolortabsline">&nbsp;</div>

<fieldset>
  <div><a target='_blank' href="<!--[pnmodurl modname='InnoForum' func='form' ctrl='Topics']-->"><img align="absmiddle" src="<!--[modulepath]-->/pnimages/add_48.png" /><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_NEWANNOUSE']--></a></div>
</fieldset>
<fieldset>
  <legend><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_SEARCHANDDISPLAY']--></legend>
  <form action="<!--[pnmodurl nodname='InnoForum' type='admin' func='list' ctrl='Topics']-->" method="post">
     <table width="100%" border="0" align="center" bgcolor="#F0F8FF">
      <tr>
        <td><div align="right"><h><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_WORD']--></b></div></td>
        <td><input type="text" name="filter[keyword]" value="<!--[$_REQUEST.filter.keyword]-->" /> 
        <b><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_BY']--></b>
        <select name="filter[type]">
          <option value="id" <!--[selected obj_value='title' cmp_value=$_REQUEST.filter.id]--> >รหัสอ้างอิง</option>
          <option value="title" <!--[selected obj_value='title' cmp_value=$_REQUEST.filter.type]--> ><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_BYTITLE']--></option>
          <option value="name" <!--[selected obj_value='name' cmp_value=$_REQUEST.filter.type]--> ><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_BYUSER']--></option>

          <option value="category_name" <!--[selected obj_value='category_name' cmp_value=$_REQUEST.filter.type]--> ><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_BYCATEGORY']--></option>
          <option value="subcategory_name" <!--[selected obj_value='subcategory_name' cmp_value=$_REQUEST.filter.type]--> ><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_BYSUBCATEGORY']--></option>
        </select>        </td>
      </tr>
      <tr>
        <td><div align="right"><b><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_DISPLAYCATEGORY']--></b></div></td>
        <td><!--[selector_object_array_ex modname="InnoForum" 
        class="Category" 
        field="id" 
        displayField="name"  
        allText="ทุกหมวดหมู่"
        allValue=0
        name="filter[category_id]" 
        selectedValue=$_REQUEST.filter.category_id
        onChange="getSubCategory(this)"]--></td>
      </tr>
      <tr>
        <td><div align="right"><b><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_DISPLAYSUBCATEGORY']--></b></div></td>
        <td><div id='subcategory_container'>        
        <!--[assign var='category_id' value=$form.category_id]-->
        <!--[if not empty($category_id)]-->
        <!--[selector_object_array_ex modname="InnoForum" 
          class="SubCategory" 
          field="id" 
          displayField="name"  
          allText="ทุกหมวดหมู่ย่อย"
          allValue=0
          name="filter[subcategory_id]" 
          selectedValue=$_REQUEST.filter.subcategory_id
          ]-->
        <!--[else]-->
          <!--[* get table prefix for query where *]-->
          <!--[pnconfiggetvar name='prefix' assign=prefix]-->
          <!--[selector_object_array_ex modname="InnoForum" 
          class="SubCategory" 
          field="id" 
          displayField="name"  
          allText="ทุกหมวดหมู่ย่อย"
          allValue=0
          name="filter[subcategory_id]" 
          selectedValue=$_REQUEST.filter.subcategory_id]-->
        <!--[/if]-->
        </div></td>
      </tr>
      <tr>
        <td><div align="right"><b><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_DISPLAYTYPE']--></b></div></td>
        <td><!--[selector_object_array_ex modname="InnoForum" 
        class="Type" 
        field="id" 
        displayField="name"  
        allText="ทุกประเภท"
        allValue=0
        name="filter[type_id]" 
        selectedValue=$_REQUEST.filter.type_id ]--></td>
      </tr>
      <tr>
        <td></td>
        <td><button class="button" type="submit" ><img align="absmiddle" src="<!--[modulepath]-->/pnimages/001_37.png"  /><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_SEARCH']--></button></td>
      </tr>
    </table>
  </form>
</fieldset>

<fieldset>
				<!--[innopager  show=page												
                								img_prev="modules/InnoForum/pnimages/back.png"
												img_next="modules/InnoForum/pnimages/next.png"
												rowcount=$pager.numitems 
												limit=$pager.itemsperpage 
												posvar=startnum 
												shift=0
												request_uri=$smarty.server.REQUEST_URI						
												
				]-->
<table width="100%" border="0" align="center">
  <tr align="center">
    <th width="10%" bgcolor="#C7D9EB"><a href="<!--[pnmodurl modname='InnoForum' type='admin' func='list' ctrl='Topics' order='id']-->"><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_PREFIX']--></a></th>
    <th width="3%" bgcolor="#C7D9EB"><a href="<!--[pnmodurl modname='InnoForum' type='admin' func='list' ctrl='Topics' order='type']-->"><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_VP']--></a></th>
    <th width="9%" bgcolor="#C7D9EB"><a href="<!--[pnmodurl modname='InnoForum' type='admin' func='list' ctrl='Topics' order='type']-->"><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_TYPE']--></a></th>
    <th width="15%" bgcolor="#C7D9EB"><a href="<!--[pnmodurl modname='InnoForum' type='admin' func='list' ctrl='Topics' order='subcategory']-->"><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_SUBCATEGORY']--></a></th>
    <th width="35%" bgcolor="#C7D9EB"><a href="<!--[pnmodurl modname='InnoForum' type='admin' func='list' ctrl='Topics' order='title']-->"><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_TITLE']--></a></th>
    <th width="8%" bgcolor="#C7D9EB"><a href="<!--[pnmodurl modname='InnoForum' type='admin' func='list' ctrl='Topics' order='date']-->"><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_DATE']--></a></th>
    <th width="11%" bgcolor="#C7D9EB"><!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_OPERATION']--></th>
  </tr>
  <!--[foreach from=$objectArray item=item]-->
  <tr bgcolor="<!--[cycle values="#FFFFFF,#E8EFF7"]-->">
    <td>
    <div class='status_icon'>
    <!--[if $item.status eq 'F']-->
    <a href="<!--[pnmodurl modname='InnoForum' type='admin' func='status' ctrl=$_GET.ctrl table='innoforum_topics' id=$item.id status='T']-->" title="<!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_SUGGESTION']-->"><img src="<!--[modulepath]-->/pnimages/21.png"></a>
    <!--[else]-->
    <a href="<!--[pnmodurl modname='InnoForum' type='admin' func='status' ctrl=$_GET.ctrl table='innoforum_topics' id=$item.id status='F']-->" title="<!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_CANCEL']-->"><img src="<!--[modulepath]-->/pnimages/14.png"></a>
    <!--[/if]-->
    <!--[if $item.is_new eq 'T']-->
    <img src="<!--[modulepath]-->/pnimages/New_icons_32.gif">
    <!--[/if]-->
    <!--[if intval($item.count_post) gte intval($setting.HOT_STATUS)]-->
    <img src="<!--[modulepath]-->/pnimages/41.png">
    <!--[/if]-->
    </div>
      <!--[assign_val assign="item_id"   key=$item.id]-->
      <!--[assign_val assign="item_path" key="resource/innoforum_upload/medium/$item_id/topics/"]-->
      <!--[$item.ref_id]--><br/>
      <!--[if $item.has_image]-->
      <a target="_blank" href="<!--[pnmodurl modname='InnoForum' func='list' ctrl='posts' id=$item.id]-->"
                                  onmouseover="Tip('<img src=\'resource/innoforum_upload/large/<!--[$item.id]-->/topics/<!--[if $item.firstimage]--><!--[$item.firstimage]--><!--[else]--><!--[$fstimage]--><!--[/if]-->\' width=\'450\'/>')"
                                  onmouseout="UnTip()"
      >
            <!--[if $item.firstimage]-->
               <img src="resource/innoforum_upload/medium/<!--[$item.id]-->/topics/<!--[$item.firstimage]-->" width="80" height="60" />
            <!--[else]-->
              <!--[assign_scan_firstimage assign="fstimage" key=$item_path]-->
              <img src="resource/innoforum_upload/medium/<!--[$item.id]-->/topics/<!--[$fstimage]-->" width="80" height="60" />
            <!--[/if]-->
      </a>
      <!--[/if]-->
    </td>
    <td>[<!--[$item.count_view]-->/<!--[$item.count_post]-->]</td>
    <td align="center">
      <!--[if $item.type_id eq '1']-->
        <b><font color="#006600"><!--[$item.type_name]--></font></b>
      <!--[elseif $item.type_id eq '3']-->
        <b><font color="#FF0000"><!--[$item.type_name]--></font></b>
      <!--[elseif $item.type_id eq '10']-->
       <b><font color="#33CC00"><!--[$item.type_name]--></font></b>
      <!--[elseif $item.type_id eq '2']-->
       <b><font color="#FF8000"><!--[$item.type_name]--></font></b>
      <!--[else]-->
       <b><font color="#0080FF"><!--[$item.type_name]--></font></b>
      <!--[/if]-->
    </td>
    <td><!--[$item.subcategory_name]--></td>
    <td>
      <a href="<!--[pnmodurl modname='InnoForum' type='admin' func='list' ctrl='posts' id=$item.id]-->">
      <!--[$item.title|mb_truncate:80:"..."]-->
      </a>
    </td>
    <td><!--[$item.cr_date|date_format:"%d/%m/%y"]--></td>
    <td align="center">
      <!--[if $user.uid eq $item.cr_uid]-->
      <a target="_blank" href="<!--[pnmodurl modname='InnoForum' func='form' ctrl='Topics' id=$item.id]-->" title="<!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_EDIT']-->"><img src="<!--[modulepath]-->/pnimages/pencil.png" /></a>&nbsp;&nbsp;
      <!--[else]-->
      <img src="<!--[modulepath]-->/pnimages/pencil_delete.png" title="<!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_ONLYOWNER']-->"/>&nbsp;&nbsp;
      <!--[/if]-->
      <a href="<!--[pnmodurl modname='InnoForum' type='admin' func='delete' ctrl='Topics' id=$item.id]-->" title="<!--[pnml name='_INNOFORUM_ADMIN_LIST_TOPICS_DEL']-->"  onclick="return confirm('Are you sure you want to delete?')"><img src="<!--[modulepath]-->/pnimages/delete.png" /></a>
    </td>
  </tr>
  <!--[/foreach]-->
</table>
 <!--[yppager show=page 
                   img_prev="modules/InnoForum/pnimages/back.png"
                   img_next="modules/InnoForum/pnimages/next.png"
                   rowcount=$pager.numitems 
                   limit=$pager.itemsperpage 
                   posvar=startnum 
                   shift=0 
 ]-->
</fieldset>